﻿using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Media;
using LiveCharts.Definitions.Points;
using LiveCharts.Definitions.Series;
using LiveCharts.Dtos;
using LiveCharts.SeriesAlgorithms;
using LiveCharts.Wpf;

namespace LiveCharts.Wpf
{
	public class GStackedColumnSeries : Series, ISeriesView, IStackModelableSeriesView, IStackedColumnSeriesView, IGroupedStackedSeriesView
	{
		public GStackedColumnSeries()
		{
			base.Model = new StackedColumnAlgorithm(this);
			this.method_0();
		}

		public GStackedColumnSeries(object configuration)
		{
			base.Model = new StackedColumnAlgorithm(this);
			base.Configuration = configuration;
			this.method_0();
		}

	 
		public double MaxColumnWidth
		{
			get
			{
				return (double)base.GetValue(GStackedColumnSeries.MaxColumnWidthProperty);
			}
			set
			{
				base.SetValue(GStackedColumnSeries.MaxColumnWidthProperty, value);
			}
		}

		// Token: 0x17000044 RID: 68
		// (get) Token: 0x06000193 RID: 403 RVA: 0x00003026 File Offset: 0x00001226
		// (set) Token: 0x06000194 RID: 404 RVA: 0x00003038 File Offset: 0x00001238
		public double ColumnPadding
		{
			get
			{
				return (double)base.GetValue(GStackedColumnSeries.ColumnPaddingProperty);
			}
			set
			{
				base.SetValue(GStackedColumnSeries.ColumnPaddingProperty, value);
			}
		}

		// Token: 0x17000045 RID: 69
		// (get) Token: 0x06000195 RID: 405 RVA: 0x0000304B File Offset: 0x0000124B
		// (set) Token: 0x06000196 RID: 406 RVA: 0x0000305D File Offset: 0x0000125D
		public StackMode StackMode
		{
			get
			{
				return (StackMode)base.GetValue(GStackedColumnSeries.StackModeProperty);
			}
			set
			{
				base.SetValue(GStackedColumnSeries.StackModeProperty, value);
			}
		}

		// Token: 0x06000197 RID: 407 RVA: 0x0000ADF4 File Offset: 0x00008FF4
		public override IChartPointView GetPointView(ChartPoint point, string label)
		{
			Class6 @class = (Class6)point.View;
			if (@class == null)
			{
				Class6 class2 = new Class6();
				class2.IsNew = true;
				class2.method_1(new Class3());
				class2.Data = new CoreRectangle();
				class2.method_3(BarLabelPosition.Merged);
				@class = class2;
			}
			else
			{
				@class.IsNew = false;
			}
			if (@class.HoverShape != null)
			{
				@class.HoverShape.Visibility = base.Visibility;
			}
			if (base.DataLabels && @class.DataLabel == null)
			{
				@class.DataLabel = (@class.DataLabel = base.UpdateLabelContent(new DataLabelViewModel
				{
					FormattedText = label,
					Point = point
				}, @class.DataLabel));
			}
			if (!base.DataLabels && @class.DataLabel != null)
			{
				base.Model.Chart.View.RemoveFromDrawMargin(@class.DataLabel);
				@class.DataLabel = null;
			}
			return @class;
		}

		// Token: 0x06000198 RID: 408 RVA: 0x0000AED0 File Offset: 0x000090D0
		private void method_0()
		{
			base.SetCurrentValue(Series.StrokeThicknessProperty, 0.0);
			base.SetCurrentValue(GStackedColumnSeries.MaxColumnWidthProperty, 35.0);
			base.SetCurrentValue(GStackedColumnSeries.ColumnPaddingProperty, 2.0);
			base.SetCurrentValue(Series.ForegroundProperty, Brushes.White);
			Func<ChartPoint, string> value = new Func<ChartPoint, string>(this.method_1);
			base.SetCurrentValue(Series.LabelPointProperty, value);
			base.DefaultFillOpacity = 1.0;
			 
		}

		// Token: 0x17000046 RID: 70
		// (get) Token: 0x06000199 RID: 409 RVA: 0x00003070 File Offset: 0x00001270
		// (set) Token: 0x0600019A RID: 410 RVA: 0x00003078 File Offset: 0x00001278
		public object Grouping { get; set; }

		// Token: 0x0600019C RID: 412 RVA: 0x00002D24 File Offset: 0x00000F24
		[CompilerGenerated]
		private string method_1(ChartPoint chartPoint_0)
		{
			return base.Model.CurrentYAxis.GetFormatter()(chartPoint_0.Y);
		}

		// Token: 0x0400011B RID: 283
		public static readonly DependencyProperty MaxColumnWidthProperty = DependencyProperty.Register("MaxColumnWidth", typeof(double), typeof(GStackedColumnSeries), new PropertyMetadata(0.0));

		// Token: 0x0400011C RID: 284
		public static readonly DependencyProperty ColumnPaddingProperty = DependencyProperty.Register("ColumnPadding", typeof(double), typeof(GStackedColumnSeries), new PropertyMetadata(0.0));

		// Token: 0x0400011D RID: 285
		public static readonly DependencyProperty StackModeProperty = DependencyProperty.Register("StackMode", typeof(StackMode), typeof(GStackedColumnSeries), new PropertyMetadata(StackMode.Values));

		// Token: 0x0400011E RID: 286
		[CompilerGenerated]
		private object object_0;
	}
}
